home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 19.zip / BS1 part 19 / how to learn assembler.adf / CH4 / 4_1A.asm < prev    next >
Assembly Source File  |  1988-02-25  |  560b  |  18 lines

  1. ;(41a)
  2. adding1:
  3.      clr.l    D0          ; Erase D0
  4.      move     table,d0    ; First entry in D0
  5.      add      table+2,d0  ; Add second entry
  6.      add      table+4,d0  ; Add third entry
  7.      add      table+6,d0  ; Add fourth entry
  8.      add      table+8,d0  ; Add fifth entry
  9.      rts                  ; return to main program
  10.  
  11. table:   dc.w    2,4,6,8,10
  12.  
  13.      end
  14.  
  15. ;Try out the program using the debugger and single stepping through until
  16. ;you get to the RTS command.  You can see at this point that data register
  17. ;DO really contains the sum of the values.
  18.